using System;
using System.Data;
using System.Collections;

namespace Shraga.BLL
{
	[DBFunctions("Shraga_Grade.Get_Candidate_Grades","Shraga_Grade.Get_Candidate_Grades")]
	public class Grade : DBObject
	{
		#region Properties

		public int		GradeId		  { get { return base.PrimaryKey; } }		
		public String   ExameName	  { get { return base.GetStringData("EXAME_NAME"); } }
		public int      ExameId		  { get { return base.GetIntData("EXAME_ID"); } }		
		public decimal  Value		  { get { return base.GetDecimalData("GRADE_VALUE"); } }		
		public DateTime  UpdateDate	  { get { return base.LastUpdate;} }

		#endregion

		#region Constructors

		public Grade(int GradeId) 
			: base(GradeId)
			{}

		public Grade(DataRow RawDataRow) 
			: base(RawDataRow)
			{}

		#endregion

		#region Grade Methods

		public void AddColumns(Hashtable Columns, ref DataTable Source, int CandidateId)
		{
			String sThisExame = "Exame" + ExameId.ToString();
			if (Columns.ContainsKey(sThisExame))
			{
				Source.Rows.Find(CandidateId)[sThisExame] = Value;
			}
		}

		#endregion
	}
}